package com.example.listview;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import java.util.List;

public class InfoAdapt extends ArrayAdapter {
    private int reaId;;
    private TextView Text_V;
    public InfoAdapt(@NonNull Context context, int resource, List<Info> data) {
        super(context, resource,data);
        reaId = resource;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        Info info = (Info) getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(reaId,parent,false);
        Text_V =(TextView)view.findViewById(R.id.Text_V);
        Text_V.setText(info.getText());
        return view;
    }
}